class common_input:
    def __init__(self,webd):
        webd.implicitly_wait(2)
        self.msg = webd.find_elements_by_tag_name('input')
    def text(self,webd,readxlsx):
        ls = readxlsx
        count = 0
        for i in self.msg:
            try:
                if i.get_attribute('type') == 'text' or i.get_attribute('value')=='':
                    i.clear()
                    i.send_keys(ls[count])
                    webd.find_element_by_class_name('page_title').click()
                    count+=1
                elif i.get_attribute('type') == 'password' or i.get_attribute('name')=='repassword' :
                    i.clear()
                    i.send_keys(ls[count])
                    count+=1
                else:
                    pass
            except Exception as e:
                pass
    def checkbox(self,value='0'):
        try:
            for i in self.msg:
                if i.get_attribute('type') == 'checkbox' and i.get_attribute('value')==value:
                    i.click()
                else:
                    pass
        except Exception as e:
            pass
    def submit(self):
        try:
            for i in self.msg:
                if i.get_attribute('type') == 'submit' and i.get_attribute('value')=='提交':
                    i.click()
                else:
                    pass
        except Exception as e:
            pass